package com.fivestar.pmanager.core.util;

import java.io.IOException;
import java.util.Properties;

import org.springframework.core.io.support.PropertiesLoaderUtils;

public class PropertiesUtil {
	
	private static PropertiesUtil instance = null;
	private Properties fileProperties = null;
	
	private PropertiesUtil() {
		try {
			fileProperties = PropertiesLoaderUtils.loadAllProperties("file.properties");
		} catch (IOException e) {
			e.printStackTrace();
		}
	};
    
	/**
	 * 单例模式取实例
	 * @return
	 */
	public static PropertiesUtil getInstance() {
		if (instance == null) {
			instance = new PropertiesUtil();
		}
		return instance;
	}
	
	public String getFilePro(String key) {
		return fileProperties.getProperty(key);
	}
	
}
